﻿@using System.Web.Optimization
@using Ed.Common
@using Ed.Entity
@using Ed.Web.Helpers
@model Ed.Entity.TPregnanterEvaluation
@{
    Layout = null;
    //月嫂id
    var pid = (int)ViewBag.Pid;
    //创建人Id,UserLname,UserTname
    var yuesaoCreaterId = 0;
    var yuesaoCreaterName = "";
    if (ViewBag.SysUser != null)
    {
        yuesaoCreaterId = (int)ViewBag.SysUser.Id;
        yuesaoCreaterName = (string)ViewBag.SysUser.UserTname;
    }
    var life_pics = (object[])Utils.StringToObjectArray(Model.PEvaImg, ',');
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>雪绒花_月嫂信息评价记录</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" conte="conte" nt="IE=Edge" />
    @Styles.Render("~/Themes/default/css/cp.globle.min1.css")
    @Scripts.Render("~/Themes/default/js/cp.globle.min1.js")
    <!--表单异步提交,用于单文件上传-->
    <script src="/Themes/default/lib/jquery.form/jquery.form.js"></script>
    <!--文件上传js-->
    <script type='text/javascript' src="/Themes/default/lib/swfupload/swfupload.js"></script>
    <script type='text/javascript' src="/Themes/default/lib/swfupload/swfupload.queue.js"></script>
    <script src="/Themes/default/lib/swfupload/swfupload.handlers.js" type="text/javascript"></script>
    <!--上传样式-->
    <style type="text/css">
        .shenghuo .upload-btn
        {
            background: url(/Themes/default/base/images/btn_upload3.png);
            width: 217px;
            height: 40px;
        }
    </style>
    <!--初始化-->
    <script type="text/javascript">
        $(function () {
            //初始化上传控件
            $("#PEvaImg").InitSWFUpload({ btntext: "批量上传", btnwidth: 217, single: false, water: true, thumbnail: true, filesize: "2048", sendurl: "/Tools/UploadApi/", flashurl: "/Themes/default/lib/swfupload/swfupload.swf", filetypes: "*.jpg;*.jpge;*.png;*.gif;" });
        });
        //头像上传及裁切
        function do_photo_capture(obj) {
            showTopWindow("photo_show_add", "/Tools/CaptureUpload/", "图片上传", 700, 450, function () {
                //var time = new Date().getTime();
                var topWinObj = top.window.document.getElementById("frm_photo_show_add").contentWindow;
                var status = topWinObj.get_status();
                var imageurl = topWinObj.get_url();
                if (status == "true") {
                    $(obj).prev().attr("src", imageurl);
                    $(obj).next().val(imageurl);
                }
            });
            return false;
        }
    </script>
    <script type="text/javascript">
        //=============================================================
        //去除顶层加载中
        $(document).ready(function () {
            //去除加载中
            if (undefined != top.dialog.list["show_loading"]) {
                top.dialog.list["show_loading"].close().remove();
                //showTopMsg("页面加载成功！", "温馨提示", "Success");
            }
        });
        //=====================================================================
    </script>
    <!--my97DatePicker-->
    <script src="/Themes/default/lib/my97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <!--省市数据-->
    <script src="/Themes/default/base/js/city.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            validate_form();
        });
        //表单验证
        function validate_form() {
            //表单验证
            $("#pregnanterevaluation_form").validate({
                invalidHandler: function (e, validator) {
                    var msg = "有 " + validator.numberOfInvalids() + " 项填写有误，请检查！";
                    $("#msgprint").html(msg).show().focus();
                    setTimeout(function () {
                        $("#msgprint").fadeOut(500);
                        //如果动画结束则删除节点
                        if (!$("#msgprint").is(":animated")) {
                            $("#msgprint").hide();
                        }
                    }, 1000);
                },
                focusInvalid: false,
                errorPlacement: function (error, element) {
                    var errorMsg = error[0].innerHTML;
                    var elementName = element[0].name;
                    $("#" + elementName).formtip(errorMsg);
                    $("#" + elementName).attr("placeholder", errorMsg);
                },
                success: function (element) {
                    var elem = $(element)[0].htmlFor;
                    $("#" + elem).poshytip('disable');
                    $("#" + elem).poshytip('destroy');
                    $("#" + elem).removeClass("error").addClass("success");
                }
            });
        }

        //表单验证方法，供父窗口调用
        function form_valid() {
            if ($("#pregnanterevaluation_form").valid()) {
                return true;
            } else {
                return false;
            }
        }

    </script>
</head>
<body>
    <form id="pregnanterevaluation_form" name="pregnanterevaluation_form">
    <!--月嫂id-->
    @Html.Hidden("PInfoCode", @pid)
    <!--id-->
    @Html.HiddenFor(model => model.Id)
    <!--表单错误提示区-->
    <div tabindex="-1" id="msgprint" class="warning" style="position: fixed; width: 90%;
        display: none;">
        您的表单包含错误，请检查！</div>
    <div class="tab-content">
        <ul class="nav nav-tabs" id="formTab">
            <li class="active"><a href="#tab-info" data-toggle="tab">月嫂评价信息管理</a></li>
        </ul>
        <div class="tab-pane active" id="tab-info">
            <div style="height: 15px;">
            </div>
            <table width="570" border="0" cellspacing="0" cellpadding="0" class="commontable shortSelect">
                <tbody>
                    <tr>
                        <th>
                            <span class="must">*</span>评价等级：
                        </th>
                        <td>
                            <label class="radio-inline" style="color:#30C;">
                                <input type="radio" value="1" name="PEvaLevel"/>★
                            </label>
                            <label class="radio-inline" style="color:#30C;">
                                <input type="radio" value="2" name="PEvaLevel"/>★★
                            </label>
                            <label class="radio-inline" style="color:#30C;">
                                <input type="radio" value="3" name="PEvaLevel" checked="checked" />★★★
                            </label>
                        </td>
                        <th>
                            关联单号：
                        </th>
                        <td>
                            @Html.TextBoxFor(model => model.OrderCode, new { @class = "form-control", @style = "width:200px; ", @placeholder = "关联订单,没有则不填" })
                        </td>
                    </tr>
                    <tr>
                        <th>
                            @*<span class="must">*</span>*@评价内容：
                        </th>
                        <td>
                            @Html.TextAreaFor(model => model.PEvaContent, new { @class = "form-control ", @style = "width:200px; height:145px;", @placeholder = "评价内容不能为空" })
                        </td>
                        <th>
                            评价反馈：
                        </th>
                        <td>
                            <!--单文件上传开始-->
                            <div style="width: 150px; height: 130px; overflow: hidden;">
                                <img id="p_eva_imgpre" src='@Html.LoadDefaultPic(Model.PEvaImgbox, "/Themes/default/home/images/nophoto.gif")' title="" alt="" width="150px" height="130px;" />
                            </div>
                            <div style="width: 130px; height: 25px; overflow: hidden;">
                                <input type="hidden" id="PEvaImgbox" name="PEvaImgbox" value='@Html.LoadDefaultPic(Model.PEvaImgbox, "/Themes/default/home/images/nophoto.gif")' />
                                
                                <a href="javascript:;" class="files">
                                    <input type="file" style="width: 130px;" id="file_p_eva_img" name="file_p_eva_img"
                                        onchange=" PicUpload('pregnanterevaluation_form', 'file_p_eva_img', 'PEvaImgbox', 'p_eva_imgpre'); " />
                                </a>
                            </div>
                            <!--单文件上传结束-->
                        </td>
                    </tr>
                    <tr>
                        <th>
                            相关图片：
                        </th>
                        <td>
                            <div class="upload-box shenghuo" id="PEvaImg">
                                <span class="upload-progress"></span>
                            </div>
                            <div class="photo-list">
                                <ul>
                                    @foreach (var life_pic in life_pics)
                                    {
                                        //for (int i = 0; i <= 6; i++)
                                        //{
                                            try
                                            {
                                                var life_infos = life_pic.ToString().Split('|');
                                                var big = life_infos[1];
                                                var small = life_infos[2];
                                                var des = life_infos[3] ?? "暂无描述...";
                                                var pics = "0|" + big + "|" + small;
                                        <li>
                                            <input type="hidden" name="PEvaImg" value="@pics" />
                                            <input type="hidden" name="PEvaImgRemark" value="remark" />
                                            <div class="img-box">
                                                <img src="@small" bigsrc="@big" />
                                                <span class="remark"><i>@des</i></span>
                                            </div>
                                            <a href="javascript:;" onclick=" setRemark(this,
                                        'PEvaImg'); ">描述</a> <a href="javascript:;" onclick=" delImg(this); ">删除</a> </li>
                                            }
                                            catch
                                            {
                                            }
                                        //}
                                    }
                                </ul>
                            </div>                        
                        </td>
                    </tr>
                    <tr>
                        <th>
                            @*<span class="must">*</span>*@
                            评价人：
                        </th>
                        <td>
                            @Html.TextBoxFor(model => model.PEvaPerson, new { @class = "form-control", @style = "width: 200px; ", @placeholder = "" })
                        </td>
                        <th>
                            <span class="must">*</span>评价时间：
                        </th>
                        <td>
                            @Html.TextBoxFor(model => model.PEvaTime, new { @class = "form-control Wdate required dateISO", Value = Html.LoadDefaultValue(Html.DateTimeNullPalse(Model.PEvaTime).ToString("yyyy-MM-dd"), DateTime.Now.ToString("yyyy-MM-dd")), onclick = "WdatePicker()", @minlength = "10", @maxlength = "10", @style = "width: 200px; ", @placeholder = "字段提示" })
                        </td>
                    </tr>
                    <tr>
                        <th>
                            添加人：
                        </th>
                        <td>
                            @Html.DropDownListFor(model => model.PEvaCreater, @Html.BuildSelectList(@yuesaoCreaterId.ToString() + "|" + @yuesaoCreaterName, @Html.LoadDefaultValue(Model.PEvaCreater.ToString(), @yuesaoCreaterId.ToString()).ToString(), false), new { @class = "form-control", @style = "width:200px;", @disabled = "diabled" })
                            @Html.HiddenFor(model => model.PEvaCreater, new { Value = @Session[EdKeys.SESSION_USER_ID], @class = "form-control" })
                        </td>
                        <th>
                            添加时间：
                        </th>
                        <td>
                            @Html.TextBoxFor(model => model.PEvaCreattime, new { @class = "form-control isreadonly", Value = @Html.LoadDefaultValue(@Html.DateTimeNullPalse(Model.PEvaCreattime).ToString("yyyy-MM-dd"), DateTime.Now.ToString("yyyy-MM-dd")), @style = "width: 200px; ", @onfocus = "this.blur()" })
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
    </form>
</body>
</html>
